package com.xiaoyu.izf.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "user_card_info", schema = "izf", catalog = "")
public class UserCardInfo {
    private int id;
    private String bankName;
    private String bankBranchName;
    private String userName;
    private String bankAccount;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "bank_name")
    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    @Basic
    @Column(name = "bank_branch_name")
    public String getBankBranchName() {
        return bankBranchName;
    }

    public void setBankBranchName(String bankBranchName) {
        this.bankBranchName = bankBranchName;
    }

    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "bank_account")
    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserCardInfo that = (UserCardInfo) o;
        return id == that.id &&
                Objects.equals(bankName, that.bankName) &&
                Objects.equals(bankBranchName, that.bankBranchName) &&
                Objects.equals(userName, that.userName) &&
                Objects.equals(bankAccount, that.bankAccount);
    }

    @Override
    public String toString() {
        return "UserCardInfo{" +
                "id=" + id +
                ", bankName='" + bankName + '\'' +
                ", bankBranchName='" + bankBranchName + '\'' +
                ", userName='" + userName + '\'' +
                ", bankAccount='" + bankAccount + '\'' +
                '}';
    }

    @Override
    public int hashCode() {


        return Objects.hash(id, bankName, bankBranchName, userName, bankAccount);
    }
}
